﻿#ifndef RECIPEDOCKWIDGET_H
#define RECIPEDOCKWIDGET_H

#include <QDockWidget>
#include "StageControlB140/StageControl.h"
#include "CameraImagingSource/TisCamera.h"
#include "MeasureData.h"
#include "SQLiteImplement2.h"
namespace Ui {
class RecipeDockWidget;
}

class RecipeDockWidget : public QDockWidget
{
    Q_OBJECT

public:
    explicit RecipeDockWidget(QWidget *parent = nullptr);
    void attachStageControl(StageControl * control);
    void attachData(MeasurementData *data);
    void attachCamera(TisCamera *camera);
    ~RecipeDockWidget();
private slots:
    void on_toolButtonSetDir_clicked();
    void on_pushButtonCreateDatabase_clicked();

    void on_pushButtonSave_clicked();
    void on_comboBoxMeasureID_currentIndexChanged(int index);
    void on_lineEditCL_editingFinished();

    void on_pushButtonSetStartPos_clicked(); //获取起点坐标
    void on_pushButtonSetEndPos_clicked(); //获取终点坐标
    void on_pushButtonGotoStart_clicked();// 运动到起点
    void on_pushButtonGotoEnd_clicked(); //运动到终点
private:
    void data2GUI();//将 m_data 中的全部数据更新到界面上
    void GUI2Data();// 将界面上的数据更新到 m_data 中
    Ui::RecipeDockWidget *ui = nullptr;
    StageControl * m_pStageControl = nullptr;
    MeasurementData *m_pData = nullptr;
    PersistenceInterface *m_pDatabase = nullptr;
    TisCamera *m_pCamera = nullptr;
    QString m_fileName;
};

#endif // RECIPEDOCKWIDGET_H
